<?php

/*  Select_helper: for dropdown
 * author: lalene@advanzweb.com
 *
 */

function section( $name='section', $attr='', $selected=array()){
	$options = array();
	$options = array(
				'sidebar' => 'Sidebar',
				'bottom' => 'Bottom'
				);
	return form_dropdown($name,$options,$selected,$attr);
}

function level( $type='single', $name='', $attr='', $selected=array(), $default=TRUE, $title='Select Level' ){
	$options = array();
	$options = array(
				'5' => 'Register',
				'6' => 'Advertiser',
				'7' => 'Vendor',
				'1' => 'Admin'
				);
	return form_dropdown($name,$options,$selected,$attr);
}
function type( $type='single', $name='', $attr='', $selected=array(), $default=TRUE, $title='Select Type' ){
	$options = array();
	$options = array(
				'free' => 'Free',
				'premium' => 'Advertiser',
				'reseller' => 'Reseller',
				'admin' => 'Admin',
				'superadmin' => 'Super Admin'
				);
	return form_dropdown($name,$options,$selected,$attr);
}

//fct to get the level text value
function getLevel( $val ){
	$options = array(
				'5' => 'Register',
				'6' => 'Advertiser',
				'7' => 'Vendor',
				'1' => 'Admin'
				);
	foreach( $options as $key => $opt ){
		if( $key == $val ){
			return $opt;
		}
	}
	return 'Undefined';
}

function totype($name='totype', $attr='', $selected=array()){
	$options = array(
				'all' => 'All Recipients',
				'specific' => 'Specific Recipients',
				'public' => 'Public'
				);
	return form_dropdown($name,$options,$selected,$attr);
}

function getTotype( $val ){
	$options = array(
				'all' => 'All Recipients',
				'specific' => 'Specific Recipients',
				'public' => 'Public'
				);
	foreach( $options as $key => $opt ){
		if( $key == $val ){
			return $opt;
		}
	}
	return 'Undefined';
}

function month($name = '', $id = '', $attr = array(), $selected = array()){

	$name = 'month';
	$id = 'id="dob_month" onChange="some_function();"';
	$attr = '';
	$option = array(
			'na'=> 'Month',
			'1'=> 'January',
			'2'=> 'February',
			'3'=> 'March',
			'4'=> 'April',
			'5'=> 'May',
			'6'=> 'June',
			'7'=> 'July',
			'8'=> 'August',
			'9'=> 'September',
			'10'=> 'October',
			'11'=> 'November',
			'12'=> 'December'
			);

	return form_dropdown($name,$option,$selected,$id);

}

function days($name = '', $id = '', $attr = array(), $selected = array()){
	$name = 'days';
	$id = 'id="dob_day"';
	$selected='';
	$attr = '';
	$options = array();
	$options[0] = 'Day';
	for( $i=1; $i<=31; $i++ ){
		$options[$i] = $i;
	}
	return form_dropdown($name,$options,$selected,$id);

}


function days1($name = '', $id = '', $attr = array(), $selected = array()){
	$name = 'days';
	$id = 'id="dob_day1"';
	$selected='';
	$attr = '';
	$options = array();
	$options[0] = 'Day';
	for( $i=1; $i<=30; $i++ ){
		$options[$i] = $i;
	}
	return form_dropdown($name,$options,$selected,$id);

}

function days2($name = '', $id = '', $attr = array(), $selected = array()){
	$name = 'days';
	$id = 'id="dob_day2"';
	$selected='';
	$attr = '';
	$options = array();
	$options[0] = 'Day';
	for( $i=1; $i<=28; $i++ ){
		$options[$i] = $i;
	}
	return form_dropdown($name,$options,$selected,$id);

}